package tx.bjdacp.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bjdacp.model.*;
import tx.bjdacp.dao.*;
import tx.bjdacp.service.*;
import tx.bjdacp.vo.query.*;


@Entity
@Table(name = "bjdacp_drug_sell_unit_modify_log")
public class DrugSellUnitModifyLog extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "药品经营企业变更记录";
	public static final String ALIAS_DRUG_SELL_UNIT_MODIFY_LOG_ID = "drugSellUnitModifyLogId";
	public static final String ALIAS_DRUG_SELL_UNIT_ID = "drugSellUnitId";
	public static final String ALIAS_USER_INFO_ID = "userInfoId";
	public static final String ALIAS_UNIT_NAME = "企业名称";
	public static final String ALIAS_REGIST_ADDRESS = "注册地址";
	public static final String ALIAS_ARTIFICIAL_PERSON = "法定代表人";
	public static final String ALIAS_UNIT_PRINCIPAL = "企业负责人";
	public static final String ALIAS_QUALITY_PRINCIPAL = "质量负责人";
	public static final String ALIAS_APOTHECARY = "药师";
	public static final String ALIAS_SELL_MODE = "经营方式";
	public static final String ALIAS_SELL_AREA = "经营范围";
	public static final String ALIAS_STORAGE_ADDRESS = "仓库地址";
	public static final String ALIAS_LICENCE_CODE = "许可证号";
	public static final String ALIAS_UNIT_FOUND_DATE = "企业成立日期";
	public static final String ALIAS_LICENCE_GIVE_DATE = "许可证发证日期";
	public static final String ALIAS_LICENCE_EXPIRY_DATE = "许可证有效日期";
	public static final String ALIAS_GSP_CODE = "认证证书号";
	public static final String ALIAS_GSP_GIVE_DATE = "认证证书发证日期";
	public static final String ALIAS_GSP_EXPIRY_DATE = "认证证书有效期";
	public static final String ALIAS_IS_LOGOUT = "是否注销";
	public static final String ALIAS_LOGOUT_DATE = "注销日期";
	public static final String ALIAS_MOBEL_PHONE = "联系方式手机";
	public static final String ALIAS_PHONE = "联系方式座机";
	public static final String ALIAS_IS_TOUR_DRUGSTORE = "是否旅游药店";
	public static final String ALIAS_IS_SELL_CHINESE_MEDICINE = "是否中药饮片经营企业";
	public static final String ALIAS_IS_OTCUNIT = "是否OTC企业";
	public static final String ALIAS_IS_RESEND_LICENSE = "是否已换证";
	public static final String ALIAS_MODIFY_DATE = "变更时间";
	public static final String ALIAS_MODIFY_PROCEEDING = "变更事项";
	public static final String ALIAS_APOTHECARY2 = "药师2";
	public static final String ALIAS_APOTHECARY_CHINA = "中药师";

	//date formats
	public static final String FORMAT_UNIT_FOUND_DATE = DATE_FORMAT;
	public static final String FORMAT_LICENCE_GIVE_DATE = DATE_FORMAT;
	public static final String FORMAT_LICENCE_EXPIRY_DATE = DATE_FORMAT;
	public static final String FORMAT_GSP_GIVE_DATE = DATE_FORMAT;
	public static final String FORMAT_GSP_EXPIRY_DATE = DATE_FORMAT;
	public static final String FORMAT_MODIFY_DATE = DATE_FORMAT;


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * drugSellUnitModifyLogId       db_column: drug_sell_unit_modify_log_id
     */

	private java.lang.Integer drugSellUnitModifyLogId;
    /**
     * drugSellUnitId       db_column: drug_sell_unit_id
     */

	private java.lang.Integer drugSellUnitId;
    /**
     * userInfoId       db_column: user_info_id
     */

	private java.lang.Integer userInfoId;
    /**
     * 企业名称       db_column: unit_name
     */
	@Length(max=200)
	private java.lang.String unitName;
    /**
     * 注册地址       db_column: regist_address
     */
	@Length(max=200)
	private java.lang.String registAddress;
    /**
     * 法定代表人       db_column: artificial_person
     */
	@Length(max=200)
	private java.lang.String artificialPerson;
    /**
     * 企业负责人       db_column: unit_principal
     */
	@Length(max=200)
	private java.lang.String unitPrincipal;
    /**
     * 质量负责人       db_column: quality_principal
     */
	@Length(max=200)
	private java.lang.String qualityPrincipal;
    /**
     * 药师       db_column: apothecary
     */
	@Length(max=200)
	private java.lang.String apothecary;
    /**
     * 经营方式       db_column: sell_mode
     */
	@Length(max=200)
	private java.lang.String sellMode;
    /**
     * 经营范围       db_column: sell_area
     */
	@Length(max=500)
	private java.lang.String sellArea;
    /**
     * 仓库地址       db_column: storage_address
     */
	@Length(max=200)
	private java.lang.String storageAddress;
    /**
     * 许可证号       db_column: licence_code
     */
	@Length(max=200)
	private java.lang.String licenceCode;
    /**
     * 企业成立日期       db_column: unit_found_date
     */

	private java.util.Date unitFoundDate;
    /**
     * 许可证发证日期       db_column: licence_give_date
     */

	private java.util.Date licenceGiveDate;
    /**
     * 许可证有效日期       db_column: licence_expiry_date
     */

	private java.util.Date licenceExpiryDate;
    /**
     * 认证证书号       db_column: gsp_code
     */
	@Length(max=200)
	private java.lang.String gspCode;
    /**
     * 认证证书发证日期       db_column: gsp_give_date
     */

	private java.util.Date gspGiveDate;
    /**
     * 认证证书有效期       db_column: gsp_expiry_date
     */

	private java.util.Date gspExpiryDate;
    /**
     * 是否注销       db_column: is_logout
     */

	private java.lang.Integer isLogout;
    /**
     * 注销日期       db_column: logout_date
     */
	@Length(max=200)
	private java.lang.String logoutDate;
    /**
     * 联系方式手机       db_column: mobel_phone
     */
	@Length(max=200)
	private java.lang.String mobelPhone;
    /**
     * 联系方式座机       db_column: phone
     */
	@Length(max=200)
	private java.lang.String phone;
    /**
     * 是否旅游药店       db_column: is_tour_drugstore
     */

	private java.lang.Integer isTourDrugstore;
    /**
     * 是否中药饮片经营企业       db_column: is_sell_chinese_medicine
     */

	private java.lang.Integer isSellChineseMedicine;
    /**
     * 是否OTC企业       db_column: is_OTC_unit
     */

	private java.lang.Integer isOtcunit;
    /**
     * 是否已换证       db_column: is_resend_license
     */

	private java.lang.Integer isResendLicense;
    /**
     * 变更时间       db_column: modify_date
     */

	private java.util.Date modifyDate;
    /**
     * 变更事项       db_column: modify_proceeding
     */
	@Length(max=200)
	private java.lang.String modifyProceeding;
	  /**
     * apothecary2       db_column: apothecary2
     */
	@Length(max=200)
	private java.lang.String apothecary2;
    /**
     * apothecaryChina       db_column: apothecary_china
     */
	@Length(max=200)
	private java.lang.String apothecaryChina;
	//columns END


	public DrugSellUnitModifyLog(){
	}

	public DrugSellUnitModifyLog(
		java.lang.Integer drugSellUnitModifyLogId
	){
		this.drugSellUnitModifyLogId = drugSellUnitModifyLogId;
	}



	public void setDrugSellUnitModifyLogId(java.lang.Integer value) {
		this.drugSellUnitModifyLogId = value;
	}

	@Id	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "drug_sell_unit_modify_log_id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getDrugSellUnitModifyLogId() {
		return this.drugSellUnitModifyLogId;
	}

	@Column(name = "drug_sell_unit_id", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getDrugSellUnitId() {
		return this.drugSellUnitId;
	}

	public void setDrugSellUnitId(java.lang.Integer value) {
		this.drugSellUnitId = value;
	}

	@Column(name = "user_info_id", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getUserInfoId() {
		return this.userInfoId;
	}

	public void setUserInfoId(java.lang.Integer value) {
		this.userInfoId = value;
	}

	@Column(name = "unit_name", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getUnitName() {
		return this.unitName;
	}

	public void setUnitName(java.lang.String value) {
		this.unitName = value;
	}

	@Column(name = "regist_address", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getRegistAddress() {
		return this.registAddress;
	}

	public void setRegistAddress(java.lang.String value) {
		this.registAddress = value;
	}

	@Column(name = "artificial_person", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getArtificialPerson() {
		return this.artificialPerson;
	}

	public void setArtificialPerson(java.lang.String value) {
		this.artificialPerson = value;
	}

	@Column(name = "unit_principal", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getUnitPrincipal() {
		return this.unitPrincipal;
	}

	public void setUnitPrincipal(java.lang.String value) {
		this.unitPrincipal = value;
	}

	@Column(name = "quality_principal", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getQualityPrincipal() {
		return this.qualityPrincipal;
	}

	public void setQualityPrincipal(java.lang.String value) {
		this.qualityPrincipal = value;
	}

	@Column(name = "apothecary", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getApothecary() {
		return this.apothecary;
	}

	public void setApothecary(java.lang.String value) {
		this.apothecary = value;
	}

	@Column(name = "sell_mode", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getSellMode() {
		return this.sellMode;
	}

	public void setSellMode(java.lang.String value) {
		this.sellMode = value;
	}

	@Column(name = "sell_area", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getSellArea() {
		return this.sellArea;
	}

	public void setSellArea(java.lang.String value) {
		this.sellArea = value;
	}

	@Column(name = "storage_address", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getStorageAddress() {
		return this.storageAddress;
	}

	public void setStorageAddress(java.lang.String value) {
		this.storageAddress = value;
	}

	@Column(name = "licence_code", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getLicenceCode() {
		return this.licenceCode;
	}

	public void setLicenceCode(java.lang.String value) {
		this.licenceCode = value;
	}

	@Transient
	public String getUnitFoundDateString() {
		return DateConvertUtils.format(getUnitFoundDate(), FORMAT_UNIT_FOUND_DATE);
	}
	public void setUnitFoundDateString(String value) {
		setUnitFoundDate(DateConvertUtils.parse(value, FORMAT_UNIT_FOUND_DATE,java.util.Date.class));
	}

	@Column(name = "unit_found_date", unique = false, nullable = true, insertable = true, updatable = true, length = 23)
	public java.util.Date getUnitFoundDate() {
		return this.unitFoundDate;
	}

	public void setUnitFoundDate(java.util.Date value) {
		this.unitFoundDate = value;
	}

	@Transient
	public String getLicenceGiveDateString() {
		return DateConvertUtils.format(getLicenceGiveDate(), FORMAT_LICENCE_GIVE_DATE);
	}
	public void setLicenceGiveDateString(String value) {
		setLicenceGiveDate(DateConvertUtils.parse(value, FORMAT_LICENCE_GIVE_DATE,java.util.Date.class));
	}

	@Column(name = "licence_give_date", unique = false, nullable = true, insertable = true, updatable = true, length = 23)
	public java.util.Date getLicenceGiveDate() {
		return this.licenceGiveDate;
	}

	public void setLicenceGiveDate(java.util.Date value) {
		this.licenceGiveDate = value;
	}

	@Transient
	public String getLicenceExpiryDateString() {
		return DateConvertUtils.format(getLicenceExpiryDate(), FORMAT_LICENCE_EXPIRY_DATE);
	}
	public void setLicenceExpiryDateString(String value) {
		setLicenceExpiryDate(DateConvertUtils.parse(value, FORMAT_LICENCE_EXPIRY_DATE,java.util.Date.class));
	}

	@Column(name = "licence_expiry_date", unique = false, nullable = true, insertable = true, updatable = true, length = 23)
	public java.util.Date getLicenceExpiryDate() {
		return this.licenceExpiryDate;
	}

	public void setLicenceExpiryDate(java.util.Date value) {
		this.licenceExpiryDate = value;
	}

	@Column(name = "gsp_code", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getGspCode() {
		return this.gspCode;
	}

	public void setGspCode(java.lang.String value) {
		this.gspCode = value;
	}

	@Transient
	public String getGspGiveDateString() {
		return DateConvertUtils.format(getGspGiveDate(), FORMAT_GSP_GIVE_DATE);
	}
	public void setGspGiveDateString(String value) {
		setGspGiveDate(DateConvertUtils.parse(value, FORMAT_GSP_GIVE_DATE,java.util.Date.class));
	}

	@Column(name = "gsp_give_date", unique = false, nullable = true, insertable = true, updatable = true, length = 23)
	public java.util.Date getGspGiveDate() {
		return this.gspGiveDate;
	}

	public void setGspGiveDate(java.util.Date value) {
		this.gspGiveDate = value;
	}

	@Transient
	public String getGspExpiryDateString() {
		return DateConvertUtils.format(getGspExpiryDate(), FORMAT_GSP_EXPIRY_DATE);
	}
	public void setGspExpiryDateString(String value) {
		setGspExpiryDate(DateConvertUtils.parse(value, FORMAT_GSP_EXPIRY_DATE,java.util.Date.class));
	}

	@Column(name = "gsp_expiry_date", unique = false, nullable = true, insertable = true, updatable = true, length = 23)
	public java.util.Date getGspExpiryDate() {
		return this.gspExpiryDate;
	}

	public void setGspExpiryDate(java.util.Date value) {
		this.gspExpiryDate = value;
	}

	@Column(name = "is_logout", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getIsLogout() {
		return this.isLogout;
	}

	public void setIsLogout(java.lang.Integer value) {
		this.isLogout = value;
	}

	@Column(name = "logout_date", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getLogoutDate() {
		return this.logoutDate;
	}

	public void setLogoutDate(java.lang.String value) {
		this.logoutDate = value;
	}

	@Column(name = "mobel_phone", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getMobelPhone() {
		return this.mobelPhone;
	}

	public void setMobelPhone(java.lang.String value) {
		this.mobelPhone = value;
	}

	@Column(name = "phone", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getPhone() {
		return this.phone;
	}

	public void setPhone(java.lang.String value) {
		this.phone = value;
	}

	@Column(name = "is_tour_drugstore", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getIsTourDrugstore() {
		return this.isTourDrugstore;
	}

	public void setIsTourDrugstore(java.lang.Integer value) {
		this.isTourDrugstore = value;
	}

	@Column(name = "is_sell_chinese_medicine", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getIsSellChineseMedicine() {
		return this.isSellChineseMedicine;
	}

	public void setIsSellChineseMedicine(java.lang.Integer value) {
		this.isSellChineseMedicine = value;
	}

	@Column(name = "is_OTC_unit", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getIsOtcunit() {
		return this.isOtcunit;
	}

	public void setIsOtcunit(java.lang.Integer value) {
		this.isOtcunit = value;
	}

	@Column(name = "is_resend_license", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getIsResendLicense() {
		return this.isResendLicense;
	}

	public void setIsResendLicense(java.lang.Integer value) {
		this.isResendLicense = value;
	}

	@Transient
	public String getModifyDateString() {
		return DateConvertUtils.format(getModifyDate(), FORMAT_MODIFY_DATE);
	}
	public void setModifyDateString(String value) {
		setModifyDate(DateConvertUtils.parse(value, FORMAT_MODIFY_DATE,java.util.Date.class));
	}

	@Column(name = "modify_date", unique = false, nullable = true, insertable = true, updatable = true, length = 23)
	public java.util.Date getModifyDate() {
		return this.modifyDate;
	}

	public void setModifyDate(java.util.Date value) {
		this.modifyDate = value;
	}

	@Column(name = "modify_proceeding", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getModifyProceeding() {
		return this.modifyProceeding;
	}

	public void setModifyProceeding(java.lang.String value) {
		this.modifyProceeding = value;
	}

	@Column(name = "apothecary2", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getApothecary2() {
		return this.apothecary2;
	}

	public void setApothecary2(java.lang.String value) {
		this.apothecary2 = value;
	}

	@Column(name = "apothecary_china", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getApothecaryChina() {
		return this.apothecaryChina;
	}

	public void setApothecaryChina(java.lang.String value) {
		this.apothecaryChina = value;
	}


	private DrugSellUnit drugSellUnit;
	public void setDrugSellUnit(DrugSellUnit drugSellUnit){
		this.drugSellUnit = drugSellUnit;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "drug_sell_unit_id",nullable = false, insertable = false, updatable = false)
	})
	public DrugSellUnit getDrugSellUnit() {
		return drugSellUnit;
	}

	private UserInfo userInfo;
	public void setUserInfo(UserInfo userInfo){
		this.userInfo = userInfo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "user_info_id",nullable = false, insertable = false, updatable = false)
	})
	public UserInfo getUserInfo() {
		return userInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("DrugSellUnitModifyLogId",getDrugSellUnitModifyLogId())
			.append("DrugSellUnitId",getDrugSellUnitId())
			.append("UserInfoId",getUserInfoId())
			.append("UnitName",getUnitName())
			.append("RegistAddress",getRegistAddress())
			.append("ArtificialPerson",getArtificialPerson())
			.append("UnitPrincipal",getUnitPrincipal())
			.append("QualityPrincipal",getQualityPrincipal())
			.append("Apothecary",getApothecary())
			.append("SellMode",getSellMode())
			.append("SellArea",getSellArea())
			.append("StorageAddress",getStorageAddress())
			.append("LicenceCode",getLicenceCode())
			.append("UnitFoundDate",getUnitFoundDate())
			.append("LicenceGiveDate",getLicenceGiveDate())
			.append("LicenceExpiryDate",getLicenceExpiryDate())
			.append("GspCode",getGspCode())
			.append("GspGiveDate",getGspGiveDate())
			.append("GspExpiryDate",getGspExpiryDate())
			.append("IsLogout",getIsLogout())
			.append("LogoutDate",getLogoutDate())
			.append("MobelPhone",getMobelPhone())
			.append("Phone",getPhone())
			.append("IsTourDrugstore",getIsTourDrugstore())
			.append("IsSellChineseMedicine",getIsSellChineseMedicine())
			.append("IsOtcunit",getIsOtcunit())
			.append("IsResendLicense",getIsResendLicense())
			.append("ModifyDate",getModifyDate())
			.append("ModifyProceeding",getModifyProceeding())
			.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getDrugSellUnitModifyLogId())
			.toHashCode();
	}

	public boolean equals(Object obj) {
		if(obj instanceof DrugSellUnitModifyLog == false) return false;
		if(this == obj) return true;
		DrugSellUnitModifyLog other = (DrugSellUnitModifyLog)obj;
		return new EqualsBuilder()
			.append(getDrugSellUnitModifyLogId(),other.getDrugSellUnitModifyLogId())
			.isEquals();
	}
}

